package thread;

public class Demo3 {
    private static Boolean isFinished=false;
    public static void main(String[] args) {
        Thread t=new Thread(()->{
            while(isFinished){
                try {
                    Thread.sleep(1000);
                    System.out.println("adced");
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }


        });
        t.start();


        isFinished=true;

    }

}
